package wms.api.modules.menu.mapper;

import wms.api.core.mybatis.base.BaseMapper;
import wms.api.modules.menu.entity.MenuEntity;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface MenuMapper extends BaseMapper<MenuEntity> {
	/**
	 * 查询子菜单
	 * @param id
	 * @return
	 */
	List<MenuEntity> getChildren(String id);

	/**
	 * 根据code查询菜单
	 * @param systemId
	 * @param code
	 * @return
	 */
	MenuEntity getByCode(@Param("systemId") String systemId, @Param("code") String code);

	/**
	 * 删除子菜单
	 * @param id
	 * @return
	 */
	int deleteChildren(String id);

	/**
	 * 根据角色查询菜单
	 * @param roleIds
	 * @return
	 */
	List<MenuEntity> getMenuByRoles(@Param("roleIds") List<String> roleIds);
}
